# Contributor: Russ Webber <russ@rw.id.au>
# Maintainer: Russ Webber <russ@rw.id.au>
pkgname=py3-lark-parser
pkgver=1.1.9
pkgrel=1
pkgdesc="modern parsing library for Python, implementing Earley & LALR(1) and an easy interface"
url="https://github.com/lark-parser/lark"
arch="noarch"
license="MIT"
options="!check" # requires python dependency js2py
depends="python3"
makedepends="py3-setuptools py3-gpep517 py3-installer py3-wheel"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/lark-parser/lark/archive/$pkgver.tar.gz"
builddir="$srcdir/lark-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
3feb8d094937a852c38400b06c1a51683f01f608fcd72940945a26cbe08a677521e9a30671f04c3f9a240a505de12b8badf2486e052a924f569e7053f965383b  py3-lark-parser-1.1.9.tar.gz
"
